function frmBegin83() {
    win83.onshow = function() {
        win83.say('Nuevo');
    }
}

var mngTallas = new MngTallas();

function newTalla() {
    win83.clearForm();
}

function saveTalla() {
    var talla = get('txtTalla').value.toUpperCase();
    var t01 = get('txtT01').value.toUpperCase();
    var t02 = get('txtT02').value.toUpperCase();
    var t03 = get('txtT03').value.toUpperCase();
    var t04 = get('txtT04').value.toUpperCase();
    var t05 = get('txtT05').value.toUpperCase();
    var t06 = get('txtT06').value.toUpperCase();
    var t07 = get('txtT07').value.toUpperCase();
    var t08 = get('txtT08').value.toUpperCase();
    var t09 = get('txtT09').value.toUpperCase();
    var t10 = get('txtT10').value.toUpperCase();

    if (!talla || (!t01 && !t02 && !t03 && !t04 && !t05 && !t06 && !t07 && !t08 && !t09 && !t10)) {
        cAlert.show('Es necesario llenar el nombre de la Talla y al menos una medida', 1);
    } else {
        win83.loaProgram('Guardando ...');

        gMethods.groupMethods();
            mngTallas.saveTalla(talla, t01, t02, t03, t04, t05, t06, t07, t08, t09, t10);
            mngTallas.getTable();
        gMethods.execMethods();
		gMethods.onresponse = function() {
            if (this.response.saveTalla) {
                fillTable('tblTallas', this.response.getTable);
                win83.stopLoading('Se ha guardado correctamente la Talla');
                win83.clearForm();
            } else win83.stopLoading('No se ha conseguido guardar la Talla', 'error');
        };
    }
}
function editTalla(lnk) {
    var tds = lnk.parentNode.parentNode.cells;

    get('txtTalla').value = tds[0].innerHTML;
    get('txtT01').value = tds[1].innerHTML;
    get('txtT02').value = tds[2].innerHTML;
    get('txtT03').value = tds[3].innerHTML;
    get('txtT04').value = tds[4].innerHTML;
    get('txtT05').value = tds[5].innerHTML;
    get('txtT06').value = tds[6].innerHTML;
    get('txtT07').value = tds[7].innerHTML;
    get('txtT08').value = tds[8].innerHTML;
    get('txtT09').value = tds[9].innerHTML;
    get('txtT10').value = tds[10].innerHTML;

    win83.say('Modificando');
    get('txtTalla').focus();
}

function delTalla(lnk, talla) {
    cConfirm.onOK = function() {
		win83.loaProgram('Eliminando ...');

		mngTallas.deleteTalla(talla);
		mngTallas.onresponse = function() {
			if (this.response) {
				removeElement(lnk.parentNode.parentNode);
				fillTable('tblTallas');

				win83.stopLoading('Se ha eliminado correctamente la Talla');
			}   else win83.stopLoading('No se ha conseguido eliminar la Talla', 'error');
		};
	};
	cConfirm.show('Confirma que desea eliminar este Talla?');
}

function printTallas() {
     win83.showReport('tallas', 'Tallas', 'tallas.pdf');
}